package com.hp.attendance.service;

import com.hp.attendance.dao.HomepageClockInDao;
import com.hp.attendance.entity.Attendance;

import javax.xml.crypto.Data;
import java.io.IOException;
import java.sql.SQLException;
import java.util.Date;

public class HomepageService {
    private HomepageClockInDao homepageClockInDao = new HomepageClockInDao();
    /**
     * 上班签到
     * @param attendance
     */
    public void addClockIn(Attendance attendance) throws SQLException, IOException, ClassNotFoundException {
        homepageClockInDao.addClockIn(attendance);
    }

    /**
     * 下班签到
     * @param attendance
     */
    public void updateClockIn(Attendance attendance) throws SQLException, IOException, ClassNotFoundException {
        homepageClockInDao.updateClockIn(attendance);
    }

    /**
     * 根据日期查询考勤信息
     * @param day
     * @return
     */
    public Attendance getAttendance(Date day, int employee_number) throws SQLException, IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
        return homepageClockInDao.getAttendance(day,employee_number);
    }
}
